package com.wp.targetOffer;

/**
 * Created by 王萍 on 2017/7/29 0029.
 */
public class 变态版青蛙 {
    public static void main(String[] args) {

        System.out.println(JumpFloorII2(5));
    }

    public static int JumpFloorII(int target) {
        return (int) Math.pow(2, target - 1);
    }

    public static int JumpFloorII2(int target) {
        if (target <= 0) return 0;
        else if (target == 1) return 1;
        else return 2 * JumpFloorII2(target - 1);
    }
}
